<section class="panel">
    <header class="panel-heading">
        <b>上传图片</b> <br />
        多个文件可以压缩成zip文件，上传成功后会自动解压，并且保留文件结构 <br />
        支持上传png, gif, jpg, zip文件，单个文件大小限制为1GB
    </header>
    <form enctype="multipart/form-data">
        <div class="file-loading">
            <input id="resource-uploader" type="file" multiple>
        </div>
        <br>
        文件上传位置 <br><br>
        <div class="form-group">
            <select id="sel_uploaddir" class="form-control">
                <option value="">根目录</option>
                <% for(var i = 0; i < data.length; i++) {%>
                    <option value="<%=data[i]%>"><%=data[i]%></option>
                <%}%>
            </select>
        </div>
    </form>
</section>

<%- include("../jspart/with-upload") %>
<script type="text/javascript">
        function uploadExtraData(previewId, index) {
            var obj = {};
            obj["selectFolder"] = $('#sel_uploaddir').val();
            return obj;
        }
		$(function(){
            $("#resource-uploader").fileinput({
                theme: 'explorer-fa',
                language: 'zh',
                uploadUrl: 'file-upload',
                overwriteInitial: false,
                showClose: false,
                allowedFileExtensions: ['jpg', 'gif', 'png', 'zip'],
                uploadExtraData: uploadExtraData
            });
        });
</script>